#ifndef CVTKIMAGECMP_H
#define CVTKIMAGECMP_H

#include <vector>
#include <QString>
#include <QImage>
#include <QFileInfoList>
#include <QDir>
#include <QDebug>
#include <QFileDialog>
#include <vtkPoints.h>
#include <vtkSmartPointer.h>
#include <vtkMapper.h>
class CVtkImageCmp
{
public:
    struct coord3d{
        float x,y,z;
    };
    CVtkImageCmp()
    {

    }
    CVtkImageCmp(const QString&path,QStringList filters)
    {
        _path=path;

        _filters=filters;
    }
    void analysis(){
       result= mapper(analysis(_path,_filters));
    }
    std::vector<coord3d> analysis(const QString&path,QStringList filters=QStringList()<<"png"<<"jpg");
    vtkSmartPointer<vtkMapper>mapper(std::vector<coord3d> data);
    void test(){
        qDebug()<<"begin test...";
        QString name=QFileDialog::getOpenFileName(0,"images path",".");
        if(name.isEmpty())return;
        cmp(name);
        qDebug()<<"end test.";
    }
    void cmp(QString path,QStringList fileters=QStringList()<<"png"<<"jpg");
    static void showCmp(float gaps,float pixelSize,std::vector<coord3d> coords);
    vtkSmartPointer<vtkMapper> result;
protected:
    QString _path;
    QStringList _filters;
};

#endif // CVTKIMAGECMP_H
